<template>
  <div class="pchome">
    <!-- <div class="pc_title">客户招揽任务中心</div> -->

    <div class="contentbox">
      <div class="leftbox">
        <TaskList @getDetail="getDetail" ref="tasklistRef"></TaskList>
      </div>
      <div class="rightbox">
        <CarDetail :detailId="detailId" :taskData="taskData" @initData="initData"></CarDetail>
      </div>
    </div>
  </div>
</template>

<script>
import TaskList from './taskList.vue'
import { Col, Row } from 'vant'
import CarDetail from './carDetail.vue'

export default {
  name: 'repairOrder',
  components: {
    TaskList,
    // UserInfo,
    // CarBasicInfo,
    // TaskDetail,
    // FollowRecord,
    Col,
    Row,
    CarDetail
  },
  data() {
    return { taskData: {}, detailId: '', carId: '' }
  },
  beforeRouteLeave(to, from, next) {
    if (to.path == "/repairOrderDetail" || to.path == "/seatInformation") {
      //当离开的时候不是去首页的时候开启缓存
      this.$route.meta.keepAlive = true;
    } else {
      this.$route.meta.keepAlive = false;
    }
    next();
  },
  mounted() {},

  methods: {
    getDetail(taskData) {
      this.taskData = taskData
      this.detailId = taskData.billId
      this.carId = taskData.billId
    },
    initData() {
      this.$refs.tasklistRef.initData()
    }
  }
}
</script>
<style scoped>
body {
  font-size: 50px !important;

}
.leftbox {
  width: 30%;
}
.rightbox {
  width: 70%;
}
</style>
<style lang="less" >
.pchome {
  width: 100%;
  overflow: hidden;
  height: 100vh;
}
.pc_title {
  font-size: 20px;
  font-weight: bold;
  width: 100%;
  height: 50px;
  line-height: 1.2rem;
  // padding-left: 0.5rem;
  margin-left: 20px;
  border-bottom: 1px solid #f6f6f6;
}
.flexbox {
  display: flex;
}
.pc_content {
  width: 100%;
  position: relative;
  height: calc(100vh - 1.2rem);
  box-sizing: border-box;
  display: flex;
  border: 1px solid #000;
  background: #f3f3f3;
  .con_left {
    // position: absolute;
    width: 7.5rem;
    // left: 0;
    position: relative;
    border: 1px solid #000;
  }
  .con_right {
    border: 1px solid #000;
    background: #f6f6f6;
    padding-top: 0.2rem;
    padding-left: 0.2rem;
    height: calc(100vh - 1rem);
    width: 100%;
    .con_top {
      margin-bottom: 0.3rem;
      width: 100%;
    }
    .con_record {
      height: 5rem;
      width: 100%;
      margin-bottom: 0.3rem;
    }
  }
}
.taskDetail {
  width: 7.5rem;
}
.contentbox {
  box-sizing: border-box;
  display: flex;
}

</style>
